package com.plian.system.entity.fr.procurement;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * @description: 合同信息表
 * @author: gangan
 * @create: 2020-05-15 11:06
 */
@Data
@TableName("fr_procurement_contract")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ProcurementContract对象", description = "合同")
public class ProcurementContract extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主表id")
    private Long materialProcurementId;

    @ApiModelProperty(value = "合同编号")
    private String contractNumber;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "合同开始时间")
    private Date contractStartTime;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "合同结束时间")
    private Date contractEndTime;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "合同实际执行开始时间")
    private Date contractExecutionStartTime;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "合同实际执行结束时间")
    private Date contractExecutionEndTime;

    @ApiModelProperty(value = "合同状态 是否签订 1否2是")
    private Integer isSigned;

    @TableField(exist = false)
    @ApiModelProperty(value = "附件")
    private List<HashMap> docList;

    @TableField(exist = false)
    @ApiModelProperty(value = "合同附件id")
    private List<Long> contractDocIds;

    @ApiModelProperty(value = "数据来源 默认0位监管平台填报  1阳光采购平台同步")
    private String dataSource;

    @ApiModelProperty(value = "数据来源id")
    private String dataSourceId;

}
